<template>
  <div class="rightbox" v-cloak>
    <h1>公司中心 > 公司详情
      <div class="top-btn">
        <el-button type="primary" size="mini" @click="Modify">修改</el-button>
      </div>
    </h1>
    <ul class="xinxi-box">
      <li style="width:100%">
        <span>状态：</span>
        <p style="color:#f00" v-if="form.state == 0">待审核</p>
        <p style="color:green" v-if="form.state == 1">审核通过</p>
        <p style="color:#f00" v-if="form.state == -1">审核不通过({{form.remark}})</p>
      </li>
      <li>
        <span>公司名称：</span>
        <p>{{form.name}}</p>
      <li>
        <span>公司法人：</span>
        <p>{{form.legalPerson}}</p>
      </li>
      <li>
        <span>注册资金：</span>
        <p>{{form.capital}}万元</p>
      </li>
      <li>
        <span>企业类型：</span>
        <p>{{form.enterpriseType}}</p>
      </li>
      <li>
        <span>成立时间：</span>
        <p>{{form.establishment}}年</p>
      </li>
      <li>
        <span>证件类型：</span>
        <p>{{form.certType}}</p>
      </li>
      <li>
        <span>营业执照注册编码：</span>
        <p>{{form.licenseCode}}</p>
      </li>
      <li>
        <span>联系电话：</span>
        <p>{{form.phone}}</p>
      </li>
      <li>
        <span>公司地址：</span>
        <p>{{form.province + '-' + form.city + '-' + form.area + '-' + form.detailed}}</p>
      </li>
      <li style="height:200px">
        <span>公司logo: </span>
        <img style="height:100px;" :src="form.logo" alt="">
      </li>
      <li style="width:66.67%;height:200px">
        <span>营业执照: </span>
        <img :src="form.licenseMap" alt="">
      </li>
      <li style="width:50%;">
        <span>服务面积：</span>
        <p>
          <span v-for="(item, index) in form.serviceArea" :key="index">
            <span v-if="index < form.serviceArea.length - 1">{{item.value}},</span>
            <span v-if="index == form.serviceArea.length - 1">{{item.value}}</span>
          </span>
        </p>
      </li>
      <li style="width:50%;">
        <span>承受价位：</span>
        <p>
          <span v-for="(item, index) in form.serviceMoney" :key="index">
            <span v-if="index < form.serviceMoney.length - 1">{{item.value}},</span>
            <span v-if="index == form.serviceMoney.length - 1">{{item.value}}</span>
          </span>
        </p>
      </li>
      <li style="width:50%;">
        <span>服务范围：</span>
        <template>
          <el-table
            :data="form.serviceScope"
            style="width: 100%">
            <el-table-column
              prop="province"
              label="省"
              width="180">
            </el-table-column>
            <el-table-column
              prop="city"
              label="市"
              width="180">
            </el-table-column>
            <el-table-column
              prop="area"
              label="区">
            </el-table-column>
          </el-table>
        </template>
      </li>
      <li style="width:50%;">
        <span>公司简介：</span>
        <p>{{form.detailed}}</p>
      </li>
    </ul>
  </div>
</template>

<script>
import axios from 'axios'
// import qs from 'qs'
export default {
  data () {
    return {
      form: {}
    }
  },
  methods: {
    Search: function () {
      var that = this
      that.getList()
    },
    getList: function () {
      var that = this
      that.$axios.request('post', '/Company/Index')
        .then((res) => {
          if (res.code === 0) {
            that.form = res.data
            that.form.serviceScope = JSON.parse(that.form.serviceScope)
            that.form.certType = that.form.certType.value
            that.form.enterpriseType = that.form.enterpriseType.value
            that.form.establishment = that.form.establishment.split('-')[0]
          }
        })
    },
    handleCurrentChange (val) {
      var that = this
      that.pageindex = val
      that.getList()
    },
    Modify: function (scope) {
      var that = this
      that.$router.push({
        name: 'inforAdd'
      })
    }
  },
  mounted () {
    this.getList()
  }
}
</script>

<style>
.xinxi-box{
  background: #fff;
  overflow: hidden;
  margin-top: 25px;
  border-top: #dbdbdb solid 1px;
  border-left: #dbdbdb solid 1px;
  min-width: 900px;
}
.xinxi-box li{
  width: 33.33%;
  float: left;
  border-right: #dbdbdb solid 1px;
  border-bottom: #dbdbdb solid 1px;
  line-height: 45px;
  padding-left: 20px;
  padding: 2px 20px;
  font-size: 14px;
  color: #323232;
  box-sizing: border-box;
}
.xinxi-box li>span{
  float: left;
  color: #323232;
}
.xinxi-box li>p{
  color: #9c9c9c;
}
.xinxi-box li img{
  height:180px;
  margin-top: 10px;
  margin-left:10px;
}
</style>
